package net.demo.common.util;

import javax.annotation.Resource;
import javax.servlet.ServletContext;

import org.springframework.beans.factory.InitializingBean;

/**
 * 商城初始化配置
 */

public class Initializing implements InitializingBean {
	
	private String keyFile;
	
	@Resource
	private ServletContext servletContext;

	public void afterPropertiesSet() throws Exception {
		if (servletContext != null) {
			Key.readKeyFile(servletContext.getRealPath(keyFile));
			System.out.println(servletContext.getRealPath(keyFile));
		}
	}

	public String getKeyFile() {
		return keyFile;
	}

	public void setKeyFile(String keyFile) {
		this.keyFile = keyFile;
	}

}